package cn.smbms.dao.impl;

import cn.smbms.beans.Bill;
import cn.smbms.dao.BillDao;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository("billDao")
public class BillDaoImpl implements BillDao {
@Autowired
   private SqlSessionTemplate  sqlSessionTemplate;
    @Override
    public List<Bill> getBillList(Bill bill) {
        List<Bill> selectList = sqlSessionTemplate.selectList("cn.smbms.dao.BillDao.getBillList", bill);
        return  selectList;
    }

    @Override
    public void addBill(Bill bill) {
        sqlSessionTemplate.insert("cn.smbms.dao.BillDao.addBill",bill);
    }

    @Override
    public void deleteBill(Bill bill) {
        sqlSessionTemplate.delete("cn.smbms.dao.BillDao.deleteBill",bill);
    }

    @Override
    public void updateBill(Bill bill) {
        sqlSessionTemplate.update("cn.smbms.dao.BillDao.updateBill",bill);
    }
}
